package com.android.bbczw;


import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class MainActivity extends TabActivity{
	
    public RadioGroup mMainrg;
    public RadioButton mRB01;//首页
    public RadioButton mRB02;//信息
    public RadioButton mRB03;//我的微博
    public RadioButton mRB04;//评论
    public RadioButton mRB05;//更多
    public View msgTitle;
    public static final String TS_HOME="home";
    public static final String TS_MESSAGE="msg";
    public static final String TS_MyCONTENT="mc";
	private TabHost tabhost ;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated metabhostod stub
		Log.d("MainActivity", "--------------------onCreate");
		super.onCreate(savedInstanceState);
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		this.setContentView(R.layout.tab);
		
//		mMainrg=(RadioGroup)this.findViewById(R.id.main_radio);
		mRB01=(RadioButton)this.findViewById(R.id.radio_button0);
		mRB01.setId(0);
		mRB02=(RadioButton)this.findViewById(R.id.radio_button1);
		mRB02.setId(1);
		mRB03=(RadioButton)this.findViewById(R.id.radio_button2);
		mRB03.setId(2);
		mRB04=(RadioButton)this.findViewById(R.id.radio_button3);
		mRB04.setId(3);
		mRB05=(RadioButton)this.findViewById(R.id.radio_button4);
		mRB05.setId(4);
		
		OnClickListener listener = new OnClickListener (){
        	public void onClick(View paramView) {
        		getContact();
        	}};
    	mRB04.setOnClickListener(listener);
//		msgTitle=this.findViewById(R.id.msg_title);
//		
//		//添加子页
//		tabhost = this.getTabHost();
//		TabSpec tsHome=tabhost.newTabSpec(TS_HOME);
//		tsHome.setIndicator(TS_HOME);
//		tsHome.setContent(new Intent(this,MyWeiBoActivity.class));
//		tabhost.addTab(tsHome);//添加用户微博首页
//		//--------------
//		TabSpec tsMSG=tabhost.newTabSpec(TS_MESSAGE);
//		tsMSG.setIndicator(TS_MESSAGE);
//		tsMSG.setContent(new Intent(this,MyWeiBoActivity.class));
//		tabhost.addTab(tsMSG);//添加用户信息窗口
//		//---------------
//		TabSpec tsMyContent=tabhost.newTabSpec(TS_MyCONTENT);
//		tsMyContent.setIndicator(TS_MyCONTENT);
//		tsMyContent.setContent(new Intent(this,MyWeiBoActivity.class));
//		tabhost.addTab(tsMyContent);//添加用户信息窗口

	   // MainService.allActivity.add(this);//添加MainActivity到Service
		//Intent it=new Intent(this,MainService.class);
		//this.startService(it); //启动weibo服务组件
		
	}
	
	private void getContact() {
		Intent intent = new Intent();	
		intent.setClass(MainActivity.this, GetContactActivity.class);
		startActivity(intent);  
		finish();
	}
}
